<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="css/login.css">
  <link rel="stylesheet" href="css/main.css">
  <title>登录</title>
</head>
<body onload="isLogin()">
  <div class="main">
    <h1>登录</h1>
    <div class="login-method">
      <span class="email-method" onclick="switchLoginMethod('email')">使用邮箱登录</span>
      <span onclick="switchLoginMethod('username')">使用用户名登录</span>
    </div>
    <div class="email-login active">
      <form name="loginFormByEmail" method="post">
        <table>
          <tr>
            <td>邮箱</td>
            <td>
              <input type="text" name="email" value="" placeholder="请输入您的邮箱"/>
            </td>
          </tr>
          <tr>
            <td>密码</td>
            <td>
              <input type="password" name="password" value="" placeholder="请输入您的密码"/>
            </td>
          </tr>
        </table>
        <div class="item">
          <input type="checkbox" name="save" value="save"/>保存15天
          <span onclick="changeForgetPage('open')" class="forget-btn">忘记密码</span>
        </div>
        <div class="item">
          <button type="button" name="submit" value="submit" onclick="login('email')">提交</button>
        </div>
      </form>
    </div>
    <div class="username-login">
      <form name="loginFormByUsername" method="post">
        <table>
          <tr>
            <td>用户名</td>
            <td>
              <input type="text" name="username" value="" placeholder="请输入您的用户名"/>
            </td>
          </tr>
          <tr>
            <td>密码</td>
            <td>
              <input type="password" name="password" value="" placeholder="请输入您的密码"/>
            </td>
          </tr>
        </table>
        <div class="item">
          <input type="checkbox" name="save" value="save"/>保存15天
          <span onclick="changeForgetPage('open')" class="forget-btn">忘记密码</span>      
        </div>
        <div class="item">
          <button type="button" name="submit" value="submit" onclick="login('username')">提交</button>
        </div>
      </form>
    </div>
    <br>
    <p>第一次访问？<a href="register.html">点击这里</a>注册</p>
  </div>
  <div class="layer">
    <div class="forget">
      <div class="operation-bar">
        <span onclick="changeForgetPage('close')">X</span>
      </div>
      <h2>忘记密码了</h2>
      <form name="forgetPass" method="post">
        <table>
          <tr>
            <td>邮箱</td>
            <td>
              <input type="text" name="email" value="" placeholder="请输入您的邮箱"/>
            </td>
            <td>
              <button type="button" onclick="getCode()" id="get-code">获取验证码</button>
            </td>
          </tr>
          <tr>
            <td>验证码</td>
            <td>
              <input type="text" name="code" value="" placeholder="请输入验证码"/>
            </td>
          </tr>
          <tr>
            <td>新密码</td>
            <td>
              <input type="password" name="password" value="" placeholder="请输入新的密码"/>
            </td>
          </tr>
          <tr>
            <td>确认密码</td>
            <td>
              <input type="password" name="passwordConfirm" value="" placeholder="请再次输入新的密码"/>
            </td>
          </tr>
          <tr>
            <td>
              <button type="button" name="submit" onclick="resetPassword()" id="reset-password">修改密码</button>
            </td>
          </tr>
        </table>
      </form>
    </div>
  </div>
  <script src="js/operation.js"></script>
  <script src="js/check.js"></script>
  <script src="js/request.js"></script>
</body>
</html>